<%@page import="accessor.WareHouseAccessor"%>
<%@page import="accessor.WareHouse"%>
<%@include file="header.jsp" %>
<div class="break_line"></div>
<div class="break_line"></div>
<div id="content">
    <div id="title_content">UPDATE WAREHOUSE</div>
    <form method="POST" action="../update_warehouse">
        <%
            WareHouseAccessor wareHouseAccessor = new WareHouseAccessor();
            int wareHouseID = request.getParameter("wareHouseID") != null ? Integer.parseInt(request.getParameter("wareHouseID")) : 0;
            WareHouse wareHouse = wareHouseAccessor.getWareHouseByID(wareHouseID);
        %>
        <% if (request.getSession().getAttribute("updateWareHouseError") != null) {%>
                    <div class="form_error">
                        <% out.println(request.getSession().getAttribute("updateWareHouseError"));%>
                    </div>
                    <%}%>
        <input type="hidden" name="wareHouseID" value="<%= wareHouse != null ? wareHouse.getWareHouseID() : ""%>"/>
        <table class="form_content" width="100%">
            <tr>
                <td>WAREHOUSE NAME: </td>
                <td>
                    <% if (request.getSession().getAttribute("update_warehouse_name") != null) {%>
                    <div class="form_error">
                        <% out.println(request.getSession().getAttribute("update_warehouse_name"));%>
                    </div>
                    <%}%>
                    <input type="text" name="warehouse_name" class="form_input" value="<%= wareHouse != null ? wareHouse.getWareHouseName() : ""%>"/></td>
            </tr>
            <tr>
                <td></td>
                <td colspan="2"><input type="submit" name="submit" class="form_input" style="width: 100px;" value="Update"/></td>
            </tr>
        </table>
    </form>
</div>
<!--END content-->
<%@include file="footer.jsp" %>